package com.example.demo.service;

import com.example.demo.dao.AccountMapper;
import com.example.demo.entity.Account;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author renshuai
 * @since 2020-04-02
 */
@Service
@Transactional
public class AccountService extends ServiceImpl<AccountMapper, Account> implements IAccountService {
	
	@Autowired
	private AccountMapper accountMapper;
	
	@Autowired
	private IOrderService orderService;

	@Override
	public void updateAccount(Account acc) {
		accountMapper.updateById(acc);
		throw new RuntimeException("test exception for seata, your transaction should be rollbacked,asset=" + acc);		
	}

}
